/*
 * @Author: your name
 * @Date: 2021-04-20 19:04:06
 * @LastEditTime: 2021-04-20 19:20:54
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \api\lib\pages\animatedalignapi.dart
 */
import 'package:flutter/material.dart';

class AnimatedAlignApi extends StatefulWidget {
  AnimatedAlignApi({Key key}) : super(key: key);

  @override
  _AnimatedAlignApiState createState() => _AnimatedAlignApiState();
}

class _AnimatedAlignApiState extends State<AnimatedAlignApi> {
  var _alignment = Alignment.topLeft;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Container(
      width: 200,
      height: 200,
      color: Colors.lightBlue,
      child: AnimatedAlign(
        alignment: _alignment,
        // curve: Curves.bounceInOut,
        duration: Duration(seconds: 2),
        child: IconButton(
          icon: Icon(
            Icons.print,
            color: Colors.red,
            size: 30,
          ),
          onPressed: () {
            setState(() {
              _alignment = Alignment.bottomRight;
            });
          },
        ),
      ),
    ));
  }
}
